<template>
  <div class="container flex-cac">
    <div class="logo">
      <img class="logo-img" src="../../assets/image/logo.jpeg"/>
    </div>
    <div class="oper fs-22 config" @click="goConfig">游戏配置</div>
    <div class="oper fs-22" :class="{'active': ready}">开始游戏</div>
  </div>
</template>

<script>
import isEmptyObj from '../../utils/isEmptyObj'
import {mapState} from 'vuex'
export default {
  data () {
    return {
    }
  },
  computed: {
    ...mapState(['gameConfig']),
    ready () {
      return !isEmptyObj(this.gameConfig)
    }
  },
  onShareAppMessage () {
    return {
      title: '狼人杀上帝好帮手',
      path: '/pages/index/main'
    }
  },

  methods: {
    goConfig () {
      wx.navigateTo({
        url: '/pages/config/main'
      })
    }
  }
}
</script>

<style lang="stylus" rel="stylesheet/stylus">
  .container
    width 100vw
    height 100vh
    .logo
      width 100vw
      height 75vw
      .logo-img
        width 100vw
        height 75vw
    .oper
      width 50vw
      height 10vh
      line-height 10vh
      text-align center
      color #fff
      border-radius 10px
      background-color #dcdcdc
      &.active
        background-color #49ce40
      &.config
        background-color #2d92ff
</style>
